package ar.com.sectorwine.repository;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import ar.com.sectorwine.entities.Users;

@Repository
public class UsuariosDAOImpl extends AbstractJpaDAO<Users> implements UsuariosDAO,
		 Serializable {

	public UsuariosDAOImpl() {
		setClazz(Users.class);
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -4919661432838220680L;

	@Override
	public Users findByUserName(String username) {
		return entityManager.find(clazz, username);
	}

	@Override
	public List<Users> findByEmail(String email) {
		Map<String, String> map = new HashMap<String, String>();
		map.put("email", email);
		List<Users> userByEmail = findByAttributes(map);
		return userByEmail;
	}
	
	
	
}
